<?php

class IkebanaUnlockQueueAction extends SzAbstractAction
{
    protected $paramTypes = array(
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT
    );

    /**
     * 解锁插花队列
     *
     * @param int $userId
     * @param int $type
     * @param int $unlockIndex
     * @param int $reqTime
     * @return SzResponse
     */
    public function execute($userId, $type, $unlockIndex, $reqTime)
    {
        if (!GameService::get()->verifySysUnlock($userId, GameConst::FUNC_FLOWER_MAKE)) {
            return $this->buildResponse(false);
        }

        GameService::get()->validateMultiRequestTimeDelta($userId, $reqTime);

        return $this->buildResponse(array(
            IkebanaService::get()->unlockQueue($userId, $type, $unlockIndex, $reqTime)
        ));
    }
}